package com.ctshk.sapp.order.ship.controller;

import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.model.PageResponse;
import com.ctshk.common.web.support.BaseController;
import com.ctshk.rpc.order.ship.dto.OperationLogDTO;
import com.ctshk.rpc.order.ship.req.OperationLogReq;
import com.ctshk.rpc.order.ship.service.IOperationLogService;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @Description
 * @Author wansi <gaylen15527491065@yeah.net>
 * @Date 2021/5/26
 */
@RestController
@RequestMapping("/operation-log")
public class OperationLogController extends BaseController {
    @DubboReference
    private IOperationLogService iOperationLogService;

    @ApiOperation(value="操作记录记录", notes="操作记录记录(陈雷)")
    @OperationLogAnnotation(operModul = OperationLogModel.VISA, operType = OperationLogType.ADD, operTitle = "操作记录记录", operDesc = "操作记录记录")
    @PostMapping("/list")
    public Result<PageResponse<OperationLogDTO>> list(@RequestBody @Valid OperationLogReq operationLogReq) {
        return Result.success(iOperationLogService.list(operationLogReq));
    }
}
